diff --git a/modules/graphviz/graphviz.module b/modules/graphviz/graphviz.module
index 9f23231..0b85c90 100644
--- a/modules/graphviz/graphviz.module
+++ b/modules/graphviz/graphviz.module
@@ -140,7 +140,8 @@ function graphviz_to_dot($graph) {
   $dot = array();
   $dot[] = "digraph {";
   // TODO: make a proper result
-  //$tree = graphapi_get_graph_tree();
+  // $tree = graphapi_get_graph_tree();
+  // Print nodes
   foreach ($graph as $id => $node) {
     if (isset($node['_subgraph'])) {
       $dot[] = '  subgraph cluster_' . $id . ' {';
@@ -161,10 +162,12 @@ function graphviz_to_dot($graph) {
       $dot[] = '  ]';
     }
   }
-
+  // Print links
   foreach ($graph as $id => $node) {
     foreach ($node['edges'] as $eid => $edge) {
-      $dot[] = "  node_$id -> node_$eid";
+      if (empty($graph[$eid]['_subgraph'])) {
+        $dot[] = "  node_$id -> node_$eid";
+      }
     }
   }
   $dot[] = '}';
